
// var ss= popup(null,"123",false,)
// var contents = readFile("/sdcard/Android/xintiao.xml" )
// var dangqian = new Date().getTime()
// var ff= dangqian - parseInt(contents)
// if (ff > 5 * 1000) {
//     // loadApp("com.huawei.app.servers",void 0,false)
//     shell("am start -n com.huawei.app.servers")
// }else{
//     // loadApp("")
// }

// var date = new Date()
//         var name = date.getFullYear()+"-"+ date.getMonth() + "-" + date.getDay() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
//         log(name)

// let arr = files.listDir("/sdcard/")
// log(arr)
//             arr.sort()
//             log(arr)

function 获取姿态() {
    var sensor = sensors.register("orientation");
    if (sensor == null) {
        return
    }
    //监听数据
    var 姿态 = {}
    sensor.on("change", (event, azimuth, pitch, roll) => {
        log("方位角:"+azimuth);
        姿态.azimuth = azimuth
        log("机身方向"+pitch);
        姿态.pitch = pitch
        log("Y:"+roll);
        姿态.roll = roll
    });
    // setTimeout(()=>{
    //     sensors.unregister(sensor);
    //     log(姿态)
    // },3000)
}
获取姿态()
